Skip to content

feat(points): implement robust points and XP calculation system#226

Merged
phertyameen merged 2 commits intoMindBlockLabs:mainfrom
dotandev:feature/points-xp-system
Jan 29, 2026
Merged

feat(points): implement robust points and XP calculation system#226
phertyameen merged 2 commits intoMindBlockLabs:mainfrom
dotandev:feature/points-xp-system

Conversation

@dotandev
Copy link
Copy Markdown
Contributor

@dotandev dotandev commented Jan 29, 2026

Implements a comprehensive points and XP calculation system with non-linear level progression, streak bonuses, and daily quest integration.

Changes

Puzzles Module:

Updated base points for puzzle difficulties (Beginner: 10, Intermediate: 25, Advanced: 50, Expert: 100).

Progress Module:

Refactored ProgressCalculationProvider to use the formula: basePoints * (1 + timeBonusMultiplier) * accuracyMultiplier.
Implemented level progression logic with thresholds (L1: 0, L2: 1000, L3: 2500, L4: 5000, L5: 10000+).
Integrated streak bonuses (+10% for 3+ days, +25% for 7+ days).
Added 50 XP bonus for completion of the 10th question in a daily quest.
Fixed UserProgress entity type inconsistencies for userId, puzzleId, and categoryId to match UUID format.

Users Module:
Added helper methods getXpNeededForNextLevel() and getXpProgressPercentage() to User entity for front-end consumption.

Verification

Build: Successfully ran npm --workspace backend run build.
Lint: Passed npm --workspace backend run lint with no errors in modified files.
Logic: Verified multiplier logic and level threshold transitions manually against requirements.

Impact
Enables engaging gamification mechanics, rewarding users for consistency, speed, and accuracy.

closes #175

Copy link
Copy Markdown
Member

@phertyameen phertyameen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genius of you to to convert those id numbers to string.You did the code a favour

@phertyameen phertyameen merged commit e01a357 into MindBlockLabs:main Jan 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend Points and XP Calculation System

2 participants